package test.my.com.myapplicationtest.DesignPatterns.SingletonPattern;

/**
 * Author : Cooper
 * Time : 2017/8/18  16:49
 * Description : 推荐写法
 */

public class SingletonPatternExample {
    private SingletonPatternExample(){}

    public static SingletonPatternExample getInstance() {
        return SingletonHolder.sInstance;
    }

    private static class SingletonHolder{
        private static final SingletonPatternExample sInstance = new SingletonPatternExample();
    }
}
